//
//  playViewController.m
//  A1.0
//
//  Created by lanou3g on 15-4-2.
//  Copyright (c) 2015年 ccandxx. All rights reserved.
//

#import "playViewController.h"
#import "videoModel.h"
#import <MediaPlayer/MediaPlayer.h>
@interface playViewController ()

@property(nonatomic,strong)MPMoviePlayerController *moviePlayer;

@end

@implementation playViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self p_setupView];
    
    
    
}

- (void)p_setupView
{
    
    
    self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:_model.mp4_url]];
    self.moviePlayer.allowsAirPlay = YES;
    self.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
    self.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
    self.moviePlayer.repeatMode = MPMovieRepeatModeOne;
    [self.moviePlayer.view setFrame:[[UIScreen mainScreen]bounds]];
    [self.view addSubview:_moviePlayer.view];
    [_moviePlayer play];

    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
